<template>
  <div class="nav-header">
    <div class="fold-menu">
      <el-icon size="24px" @click="handleFoldClick">
        <component :is="isFold ? 'Fold' : 'Expand'" />
      </el-icon>
    </div>
    <div class="content">
      <Nav-breadcrumb />
      <User-info />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import UserInfo from './user-info.vue'
import NavBreadcrumb from '@/base-ui/breadcrumb/nav-breadcrumb.vue'
const emit = defineEmits(['foldChange'])

const isFold = ref(false) // 折叠菜单状态

// 菜单折叠
const handleFoldClick = () => {
  isFold.value = !isFold.value
  emit('foldChange', isFold.value)
}
</script>
<style scoped lang="less">
.nav-header {
  display: flex;
  width: 100%;
  .fold-menu {
    margin-left: 10px;
    cursor: pointer;
    position: relative;
    top: 5px;
  }
  .content {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
  }
}
</style>
